chrome.extension.onMessage.addListener(
    function (request, sender, sendMessage) {
        if (request.type == "getHtml") {
            chrome.extension.sendMessage({type: 'getHtml', html : document.body.innerHTML});
        }
    });